package com.reflect;

import java.lang.reflect.Method;

public class Demo {

	public static void main(String[] args) {
		try {
			Class<?> clazz = Thread.currentThread()
					.getContextClassLoader()
					.loadClass("com.reflect.AAA");
			
			Object param = new String ("打印，打印，打印");
			Method method = clazz.getDeclaredMethod("print", String.class);
			method.setAccessible(true);
			Object invoke = method.invoke(null, param);
			System.out.println(invoke);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		

	}

	
}
